<%--
  Created by IntelliJ IDEA.
  User: Maybe
  Date: 2024/9/26
  Time: 下午5:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Login Form</title>
</head>
<body>
<%
    // 检查是否有错误消息，并将其存储在请求属性中
    String errorMessage = (String) request.getAttribute("errorMessage");
    if (errorMessage != null && !errorMessage.isEmpty()) {
%>
<p style="color: red;"><%= errorMessage %></p>
<%
    }
%>
<form action="login" method="post"> <!-- 假设您的Servlet映射为/login -->
    <!-- 文本输入框 -->
    <label for="name">用户名:</label>
    <input type="text" id="name" name="username" required>

    <br>

    <!-- 密码输入框 -->
    <label for="password">密码:</label>
    <input type="password" id="password" name="password" required>

    <br>

    <!-- 错误消息占位符（如果需要的话，可以在Servlet中设置） -->

    <!-- 提交按钮 -->
    <input type="submit" value="提交">
</form>
</body>
</html>